/*
 * AgendaEntry.java
 *
 * Created on June 30, 2006, 1:42 PM
 *
 */

package galronnlp.pcfg.parser;

import galronnlp.util.Symbol;
import galronnlp.util.Tuple;

/**
 *
 * An extension of the Tuple class for edges in the agenda.
 * The edge is an array of Objects of size 4, with the following entries:
 * [DELTA_j, i, LHS, RHS]
 * where DELTA_j and i are <code>Integer</code>s, LHS is a <code>Symbol</code>,
 * and RHS is an <code>EntryTriple</code>
 *
 * This is based on the agenda entries as defined in Chris Brew's python
 * Statistical CKY parser
 *
 * @author Daniel A. Galron
 */
public class AgendaEntry extends Tuple implements Comparable {
    
    /** Creates a new instance of AgendaEntry */
    public AgendaEntry(int delta_j, int i, Symbol LHS, EntryTriple RHS) {
        super(4);
        this.array[0] = new Integer(delta_j);
        this.array[1] = new Integer(i);
        this.array[2] = LHS;
        this.array[3] = RHS;
    }
    

    public int compareTo(Object o) {
        AgendaEntry other = (AgendaEntry)o;
        return ((Integer)this.array[0]).compareTo((Integer)other.array[0]);
    }
    
}
